package com.example.inoculations.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInterceptor())
//                .addPathPatterns("/**")//拦截  (其他接口token验证)
//                .excludePathPatterns("/inoculations/user/login")//所有用户都放行(登录接口不放行,无法进行登录)
                .excludePathPatterns("/**");//所有接口都放行
    }
}

